home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Misc Servers / Zope.exe / PROPERTIES.DTML < prev    next >
Encoding:
Text File  |  2000-07-06  |  7.0 KB  |  218 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
  2. <html lang="en">
  3. <head>
  4. <title>Properties</title>
  5. </head>
  6. <body bgcolor="#FFFFFF" link="#000099" vlink="#555555">
  7. <dtml-var manage_tabs>
  8.  
  9. <dtml-if Principia-Version>
  10. <p>
  11. <em>You are currently working in version <dtml-var Principia-Version></em>
  12. </p>
  13. </dtml-if Principia-Version>
  14.  
  15. <form action="<dtml-var URL1>" method="POST">
  16. <dtml-if propertyMap>
  17. <p>
  18. Properties allow you to assign simple values to Zope objects. 
  19. The following properties are defined for this item. 
  20. <dtml-if property_extensible_schema__>
  21. To <a href="#addpropform">
  22. add a new property</a>, enter a name, type and value for the new property 
  23. and click the "Add" button.
  24. </dtml-if>
  25. To change property values, edit the 
  26. values and click "Save Changes". 
  27. </p>
  28. <table border="0" cellspacing="0" cellpadding="2">
  29. <tr>
  30.   <th colspan="3">Property</th>
  31.   <th>Type</th>
  32. </tr>
  33.  
  34. <dtml-in propertyMap mapping>
  35. <tr>
  36.   <td align="left" valign="top" width="16">
  37.   <dtml-if "'d' in _['sequence-item'].get('mode', 'awd')">
  38.   <input type="checkbox" name="ids:list" value="<dtml-var id html_quote>" ID="cb-<dtml-var id>">
  39.   <dtml-else>
  40.   </dtml-if>
  41.   </td>
  42.   <td align="left" valign="top">
  43.   <strong><LABEL FOR="cb-<dtml-var id>"><dtml-var "propertyLabel(id)"></LABEL></strong>
  44.   </td>
  45.   <td align="left" valign="top">
  46.   <dtml-if "'w' in _['sequence-item'].get('mode', 'awd')">
  47.   <dtml-if "type == 'int'">
  48.   <input type="text" name="<dtml-var id>:<dtml-var type>" size="35"
  49.    value="<dtml-if "hasProperty(id)"><dtml-var 
  50.    "'%s' % getProperty(id)" html_quote></dtml-if>">
  51.   <dtml-elif "type == 'long'">
  52.   <input type="text" name="<dtml-var id>:<dtml-var type>" size="35"
  53.    value="<dtml-if "hasProperty(id)"><dtml-var 
  54.    "('%s' % getProperty(id))[:-1]" html_quote></dtml-if>">
  55.   <dtml-elif "type in ('float', 'date')">
  56.   <input type="text" name="<dtml-var id>:<dtml-var type>" size="35"
  57.    value="<dtml-var "getProperty(id)" html_quote>">
  58.   <dtml-elif "type=='string'">
  59.   <input type="text" name="<dtml-var id>:string" size="35"
  60.    value="<dtml-var "getProperty(id)" html_quote>">
  61.   <dtml-elif "type=='boolean'">
  62.   <input type="checkbox" name="<dtml-var id>:boolean" size="35"
  63.    <dtml-if "getProperty(id)">CHECKED</dtml-if>>
  64.   <dtml-elif "type=='tokens'">
  65.   <input type="text" name="<dtml-var id>:tokens" size="35"
  66.    value="<dtml-in "getProperty(id)"><dtml-var sequence-item html_quote> </dtml-in>">
  67.   <dtml-elif "type=='text'">
  68.   <textarea name="<dtml-var id>:text" rows="6" cols="35"><dtml-var 
  69.    "getProperty(id)" html_quote></textarea>
  70.   <dtml-elif "type=='lines'">
  71.   <textarea name="<dtml-var id>:lines" rows="6" cols="35"><dtml-in
  72.   "getProperty(id)"><dtml-var sequence-item html_quote><dtml-if
  73.    sequence-end><dtml-else><dtml-var "'\n'"></dtml-if></dtml-in></textarea>
  74.  
  75.   <dtml-elif "type=='selection'">
  76.  
  77.     <dtml-if "hasProperty(select_variable)">
  78.     <select name="<dtml-var id>">
  79.       <dtml-in "getProperty(select_variable)">
  80.          <option
  81.           <dtml-if "_['sequence-item']==getProperty(id)">SELECTED</dtml-if>
  82.           ><dtml-var sequence-item html_quote></option>
  83.       </dtml-in>
  84.     </select>
  85.     <dtml-elif "_.has_key(select_variable)">
  86.     <select name="<dtml-var id>">
  87.       <dtml-in "_[select_variable]">
  88.          <option
  89.           <dtml-if "_['sequence-item']==getProperty(id)">SELECTED</dtml-if>
  90.           ><dtml-var sequence-item html_quote></option>
  91.       </dtml-in>
  92.     </select>
  93.     <dtml-else>
  94.        No value for <dtml-var select_variable>.
  95.     </dtml-if>
  96.  
  97.   <dtml-elif "type=='multiple selection'">
  98.  
  99.     <dtml-if "hasProperty(select_variable)">
  100.     <select name="<dtml-var id>:list" multiple
  101.       size="<dtml-var "_.min(7, _.len(getProperty(select_variable)))">">
  102.       <dtml-in "getProperty(select_variable)">
  103.          <option<dtml-if 
  104.          "getProperty(id) and (_['sequence-item'] in getProperty(id))"
  105.          > SELECTED</dtml-if
  106.          >><dtml-var sequence-item html_quote></option>
  107.       </dtml-in>
  108.     </select>
  109.     <dtml-elif "_.has_key(select_variable)">
  110.     <select name="<dtml-var id>:list" multiple
  111.       size="<dtml-var "_.min(7, _.len(_[select_variable]))">">
  112.       <dtml-in "_[select_variable]">
  113.          <option<dtml-if 
  114.          "getProperty(id) and (_['sequence-item'] in getProperty(id))"
  115.          > SELECTED</dtml-if
  116.          >><dtml-var sequence-item html_quote></option>
  117.       </dtml-in>
  118.     </select>
  119.     <dtml-else>
  120.     No value for <dtml-var select_variable>.
  121.     </dtml-if>
  122.  
  123.   <dtml-else>
  124.   <em>Unknown property type</em>
  125.   </dtml-if>
  126.   <dtml-else>
  127.   <table border="1">
  128.   <tr><td><dtml-var "getProperty(id)" html_quote></td></tr>
  129.   </table>
  130.   </dtml-if>
  131.   </td>
  132.   <td align="left" valign="top">
  133.   &dtml-type;
  134.   </td>
  135. </tr>
  136. </dtml-in>
  137. <tr>
  138.   <td colspan="2"> </td>
  139.   <td align="left" valign="top">
  140.   <input type="submit" name="manage_editProperties:method" 
  141.    value="Save Changes">
  142. <dtml-if property_extensible_schema__>
  143.   <input type="submit" name="manage_delProperties:method" value="Delete">
  144.   </td>
  145.   <td>
  146.   <dtml-comment>
  147.   This needs some community review before exposing it officially.
  148.   <input type="submit" name="manage_propertyTypeForm:method" value="Change Names/Types">
  149.   </dtml-comment>
  150.   </td>
  151. <dtml-else>
  152.   <td> </td>
  153. </dtml-if>
  154.   </td>
  155. </tr>
  156. </table>
  157.  
  158. <dtml-else>
  159. <p>
  160. Properties allow you to assign simple values to Zope objects. 
  161. There are currently no properties defined for this item. 
  162. <dtml-if property_extensible_schema__>
  163. To add a property, click the "Add..." button.
  164. </dtml-if>
  165. </p>
  166.  
  167. </dtml-if>
  168. </form>
  169.  
  170. <dtml-if property_extensible_schema__>
  171. <a name="addpropform">
  172. <form action="<dtml-var URL1>/manage_addProperty" method="POST">
  173. <p>
  174. To add a new property, enter a name, type and value for the new 
  175. property and click the "Add" 
  176. button. For "selection" and "multiple selection"
  177. properties enter the name of a selection variable in the "Value"
  178. field. The selection variable is a property or method that returns a list
  179. of strings from which the selection(s) can be chosen.
  180. </p>
  181. <table>
  182. <tr>
  183.   <th align="left" valign="top">Name</th>
  184.   <td align="left" valign="top"><input type="text" name="id" size="20"></td>
  185.   <th align="left" valign="top">Type</th>
  186.   <td align="left" valign="top">
  187.     <select name="type">
  188.       <option>boolean</option>
  189.       <option>date</option>
  190.       <option>float</option>
  191.       <option>int</option>
  192.       <option>lines</option>
  193.       <option>long</option>
  194.       <option SELECTED>string</option>
  195.       <option>text</option>
  196.       <option>tokens</option>
  197.       <option>selection</option>
  198.       <option>multiple selection</option>
  199.     </select>
  200.   </td>
  201. </tr>
  202. <tr>
  203.   <th align="left" valign="top">Value</th>
  204.   <td colspan=2 align="left" valign="top">
  205.     <input type="text" name="value" size="30">
  206.   </td>
  207.   <td align="right" valign="top">
  208.   <input type="submit" value=" Add ">
  209.   </td>
  210. </tr>
  211. </table>
  212. </form>
  213. </dtml-if>
  214.  
  215. </body>
  216. </html>
  217.  
  218.